import { http } from '@/utils/request'
import type { ILogin, ILoginRes } from './type'

const prefix = import.meta.env.VITE_API_AUTH

export function login(data: ILogin) {
	return http.post<ILoginRes>(`${prefix}/login`, data)
}

export function userLogout() {
	return http.delete(`${prefix}/logout`)
}
